home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1115 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.5 KB  |  47 lines

  1. Newsgroups: comp.lang.c++
  2. Path: peer-news.britain.eu.net!uknet!owl-uk!news
  3. From: Kenn@owl-uk.co.uk (Ken Nicolson)
  4. Subject: Re: (HUGE) Help!  This bug is killing me!  Anyone have any ideas?
  5. Message-ID: <30f254ad.95008793@hector>
  6. Sender: news@owl-uk.co.uk (News system)
  7. Organization: Office Workstations Limited
  8. X-Newsreader: Forte Agent .99c/16.141
  9. References: <4cjmbt$gaf@maverick.tad.eds.com>
  10. Date: Tue, 9 Jan 1996 11:49:58 GMT
  11.  
  12. fignet05.darrins@eds.com (Darrin Smith) wrote:
  13.  
  14. >First off thanks for reading (sorry this is so HUGE) and helping me save my 
  15. >sanity.
  16. >
  17.  
  18. 862 lines! Give us a break!
  19.  
  20. >Now, the following program seems to work perfectly until the final statement, 
  21. >at which time Win95 reports that an execution of an invalid instruction has 
  22. >been attenmpted, and that the program will be terminated.
  23. >
  24.  
  25. >void main()
  26.  
  27. Well, the program is free to crash if you declare main like that, I
  28. suppose, so the behaviour you are seeing could be consistent...
  29.  
  30. > ccun_detail *detail;
  31. [snip!]
  32. >      found=fread(detail,sizeof(ccun_detail),1,infile);
  33.  
  34. No allocation of space for "detail". Go to the bottom of the class.
  35.  
  36. >Well I've spent 3 days now trying to figure out what is wrong with this 
  37.  
  38. Three days you've spent? Are you sure you're in the right job?
  39. Crashing exiting a function is a sure sign that you've got a wayward
  40. pointer crapping on the stack. This took me two minutes to find,
  41. without even going near a C compiler.
  42.  
  43. I could spend ages commenting on the nightmarish C/C++ hybrid coding,
  44. but I've got better things to do with my time.
  45.  
  46. Ken
  47.